//
//  EventsHeadView.m
//  TodatPlay
//
//  Created by dllo on 16/9/8.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "EventsHeadView.h"
#import "SDAutoLayout.h"
@implementation EventsHeadView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createContents];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}
- (void)createContents {
    self.backImageView = [UIImageView new];
    self.titleLabel = [UILabel new];
    self.summaryLabel = [UILabel new];
    [self addSubview:_backImageView];
    [self addSubview:_titleLabel];
    [self addSubview:_summaryLabel];
    
    self.backImageView.sd_layout
    .leftEqualToView(self)
    .topEqualToView(self)
    .rightEqualToView(self)
    .heightIs(self.frame.size.height * 3 / 4.0);
    
    self.titleLabel.sd_layout
    .centerXEqualToView(self)
    .topSpaceToView(self.backImageView, 10)
    .heightIs(20)
    .leftEqualToView(self)
    .rightEqualToView(self);
    
    
    self.summaryLabel.sd_layout
    .centerXEqualToView(self)
    .topSpaceToView(self.titleLabel, 5)
    .heightIs(20)
    .leftEqualToView(self)
    .rightEqualToView(self);

    
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.summaryLabel.font = [UIFont systemFontOfSize:13];
    self.summaryLabel.textColor = [UIColor colorWithWhite:0.600 alpha:1.000];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.summaryLabel.textAlignment = NSTextAlignmentCenter;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
